package main

import (
	"net"

	"github.com/ngaut/log"
)

func tGetInterfaces() {
	ifaces, _ := net.Interfaces()
	for _, i := range ifaces {
		addrs, _ := i.Addrs()
		for _, addr := range addrs {
			var ip net.IP
			switch v := addr.(type) {
			case *net.IPNet:
				ip = v.IP
			case *net.IPAddr:
				ip = v.IP
			}
			log.Infof("intf: %v, ip: %v", i.Name, ip)
		} 
	}

	addrs, _ := net.InterfaceAddrs() 
	for _, addr := range addrs {
		log.Infof("addr: %v", addr)
	}	
	
}

func main()  {
	tGetInterfaces()
}